// pages/examination-detail/examination-detail.js
Page({
  data: {
    examinationInfo: {
      title: '血常规三项',
      items: [
        { id: 1, name: '血红蛋白', measuredValue: '300g/L', referenceRange: '参考范围: 115-150g/L' },
        { id: 2, name: '红细胞', measuredValue: '300g/L', referenceRange: '参考范围: 115-150g/L' },
        { id: 3, name: '血小板', measuredValue: '300g/L', referenceRange: '参考范围: 115-150g/L' },
        { id: 4, name: '单核细胞绝对值', measuredValue: '300g/L', referenceRange: '参考范围: 115-150g/L' },
        { id: 5, name: '淋巴细胞绝对值', measuredValue: '300g/L', referenceRange: '参考范围: 115-150g/L' },
        { id: 6, name: '淋巴细胞百分比', measuredValue: '300g/L', referenceRange: '参考范围: 115-150g/L' },
        { id: 7, name: '平均红细胞体积', measuredValue: '300g/L', referenceRange: '参考范围: 115-150g/L' }
      ]
    }
  },

  onLoad(options) {
    console.log('检查项目详情页面加载');
    if (options.item) {
      const item = JSON.parse(options.item);
      console.log('接收到的检查项目信息:', item);
      this.setExaminationInfoByType(item);
    }
  },

  setExaminationInfoByType(item) {
    const examinationInfoMap = {
      '一般检查': {
        title: '一般检查',
        items: [
          { id: 1, name: '身高', measuredValue: '175cm', referenceRange: '参考范围: 160-180cm' },
          { id: 2, name: '体重', measuredValue: '70kg', referenceRange: '参考范围: 50-80kg' },
          { id: 3, name: '血压', measuredValue: '120/80mmHg', referenceRange: '参考范围: 90-140/60-90mmHg' },
          { id: 4, name: '体温', measuredValue: '36.5°C', referenceRange: '参考范围: 36.0-37.0°C' },
          { id: 5, name: '脉搏', measuredValue: '75次/分', referenceRange: '参考范围: 60-100次/分' }
        ]
      },
      '内科检查': {
        title: '内科检查',
        items: [
          { id: 1, name: '心脏', measuredValue: '正常', referenceRange: '参考范围: 正常' },
          { id: 2, name: '肺部', measuredValue: '正常', referenceRange: '参考范围: 正常' },
          { id: 3, name: '腹部', measuredValue: '正常', referenceRange: '参考范围: 正常' },
          { id: 4, name: '肝脏', measuredValue: '正常', referenceRange: '参考范围: 正常' },
          { id: 5, name: '脾脏', measuredValue: '正常', referenceRange: '参考范围: 正常' }
        ]
      },
      '外科检查': {
        title: '外科检查',
        items: [
          { id: 1, name: '皮肤', measuredValue: '正常', referenceRange: '参考范围: 正常' },
          { id: 2, name: '淋巴结', measuredValue: '正常', referenceRange: '参考范围: 正常' },
          { id: 3, name: '甲状腺', measuredValue: '正常', referenceRange: '参考范围: 正常' },
          { id: 4, name: '四肢', measuredValue: '正常', referenceRange: '参考范围: 正常' },
          { id: 5, name: '脊柱', measuredValue: '正常', referenceRange: '参考范围: 正常' }
        ]
      },
      '血常规': {
        title: '血常规',
        items: [
          { id: 1, name: '白细胞计数', measuredValue: '6.5×10^9/L', referenceRange: '参考范围: 3.5-9.5×10^9/L' },
          { id: 2, name: '红细胞计数', measuredValue: '4.8×10^12/L', referenceRange: '参考范围: 3.5-5.5×10^12/L' },
          { id: 3, name: '血红蛋白', measuredValue: '145g/L', referenceRange: '参考范围: 130-175g/L' },
          { id: 4, name: '血小板计数', measuredValue: '250×10^9/L', referenceRange: '参考范围: 100-300×10^9/L' },
          { id: 5, name: '中性粒细胞', measuredValue: '65%', referenceRange: '参考范围: 50-70%' },
          { id: 6, name: '淋巴细胞', measuredValue: '25%', referenceRange: '参考范围: 20-40%' },
          { id: 7, name: '单核细胞', measuredValue: '8%', referenceRange: '参考范围: 3-10%' }
        ]
      },
      '尿常规': {
        title: '尿常规',
        items: [
          { id: 1, name: '尿比重', measuredValue: '1.020', referenceRange: '参考范围: 1.010-1.025' },
          { id: 2, name: 'pH值', measuredValue: '6.5', referenceRange: '参考范围: 5.0-7.0' },
          { id: 3, name: '蛋白质', measuredValue: '阴性', referenceRange: '参考范围: 阴性' },
          { id: 4, name: '葡萄糖', measuredValue: '阴性', referenceRange: '参考范围: 阴性' },
          { id: 5, name: '酮体', measuredValue: '阴性', referenceRange: '参考范围: 阴性' },
          { id: 6, name: '潜血', measuredValue: '阴性', referenceRange: '参考范围: 阴性' },
          { id: 7, name: '白细胞', measuredValue: '0-2/HP', referenceRange: '参考范围: 0-5/HP' }
        ]
      },
      '肝功能常规': {
        title: '肝功能常规',
        items: [
          { id: 1, name: '总蛋白', measuredValue: '75g/L', referenceRange: '参考范围: 60-80g/L' },
          { id: 2, name: '白蛋白', measuredValue: '45g/L', referenceRange: '参考范围: 35-55g/L' },
          { id: 3, name: '球蛋白', measuredValue: '30g/L', referenceRange: '参考范围: 20-35g/L' },
          { id: 4, name: '总胆红素', measuredValue: '15μmol/L', referenceRange: '参考范围: 3.4-17.1μmol/L' },
          { id: 5, name: '直接胆红素', measuredValue: '5μmol/L', referenceRange: '参考范围: 0-6.8μmol/L' },
          { id: 6, name: 'ALT', measuredValue: '25U/L', referenceRange: '参考范围: 7-40U/L' },
          { id: 7, name: 'AST', measuredValue: '30U/L', referenceRange: '参考范围: 13-35U/L' }
        ]
      },
      '肾功能常规': {
        title: '肾功能常规',
        items: [
          { id: 1, name: '尿素氮', measuredValue: '5.5mmol/L', referenceRange: '参考范围: 2.9-8.2mmol/L' },
          { id: 2, name: '肌酐', measuredValue: '85μmol/L', referenceRange: '参考范围: 59-104μmol/L' },
          { id: 3, name: '尿酸', measuredValue: '350μmol/L', referenceRange: '参考范围: 208-428μmol/L' },
          { id: 4, name: '胱抑素C', measuredValue: '0.8mg/L', referenceRange: '参考范围: 0.6-1.0mg/L' },
          { id: 5, name: 'β2微球蛋白', measuredValue: '1.5mg/L', reference范围: '参考范围: 0.8-2.4mg/L' }
        ]
      },
      '腹部彩色多普勒肩检查': {
        title: '腹部彩色多普勒肩检查',
        items: [
          { id: 1, name: '肝脏大小', measuredValue: '正常', referenceRange: '参考范围: 正常' },
          { id: 2, name: '肝脏回声', measuredValue: '均匀', referenceRange: '参考范围: 均匀' },
          { id: 3, name: '胆囊大小', measuredValue: '正常', referenceRange: '参考范围: 正常' },
          { id: 4, name: '胆囊壁', measuredValue: '光滑', referenceRange: '参考范围: 光滑' },
          { id: 5, name: '胰腺大小', measuredValue: '正常', referenceRange: '参考范围: 正常' },
          { id: 6, name: '脾脏大小', measuredValue: '正常', referenceRange: '参考范围: 正常' },
          { id: 7, name: '双肾大小', measuredValue: '正常', referenceRange: '参考范围: 正常' }
        ]
      },
      '尿检': {
        title: '尿检',
        items: [
          { id: 1, name: '尿量', measuredValue: '1500ml/24h', referenceRange: '参考范围: 1000-2000ml/24h' },
          { id: 2, name: '尿色', measuredValue: '淡黄色', referenceRange: '参考范围: 淡黄色' },
          { id: 3, name: '透明度', measuredValue: '清亮', referenceRange: '参考范围: 清亮' },
          { id: 4, name: '气味', measuredValue: '正常', referenceRange: '参考范围: 正常' },
          { id: 5, name: '红细胞', measuredValue: '0-2/HP', referenceRange: '参考范围: 0-3/HP' },
          { id: 6, name: '白细胞', measuredValue: '0-3/HP', referenceRange: '参考范围: 0-5/HP' },
          { id: 7, name: '上皮细胞', measuredValue: '少量', referenceRange: '参考范围: 少量' }
        ]
      }
    };

    if (examinationInfoMap[item.name]) {
      this.setData({
        examinationInfo: examinationInfoMap[item.name]
      });
    }
  }
});



